﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void calbutton_Click(object sender, EventArgs e)
        {
            string strcal1 = calnum1.Text;
            string strcal2 = calnum2.Text;
            string strcalsym = calsym.Text;
            float calnumA = float.Parse(strcal1);
            float calnumB = float.Parse(strcal2);
            float resultnum = new float();
            if(strcalsym == "+")
            {
                resultnum = calnumA + calnumB;
            }
            else if(strcalsym == "-")
            {
                resultnum = calnumA - calnumB;
            }
            else if(strcalsym == "*")
            {
                resultnum = calnumA * calnumB;
            }
            else if(strcalsym == "/")
            {
                resultnum = calnumA / calnumB;
            }

            result.Text = resultnum + " ";

            result.Text = result.Text.Substring(0,result.Text.Length - 1);
         
        }

        private void Form1_Load_1(object sender, EventArgs e)
        {

        }
    }
}
